package com.jkl.controller.role;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.jkl.entity.role.BsRole;
import com.jkl.service.role.inter.BsRoleServiceInterface;

import lombok.extern.slf4j.Slf4j;

/**
 * 
 * <p>
 * 123开放层接口
 * <p>
 * <p>
 * 变更说明：wangjingxiang 2017年12月28日 123 增加新增、更新、删除方法
 * <p>
 * Date:2018年10月01日
 * 
 * @author lin.pf
 * @version 1.0
 */
@RestController
@RequestMapping("jky/role")
@Slf4j
public class BsRoleControllerV1 {

	@Autowired
	private HttpServletRequest request;

	@Autowired
	private BsRoleServiceInterface bsRoleServiceInterface;

	@PostMapping("/findRoleByParam")
	public PageInfo<BsRole> findRoleByParam(@RequestBody BsRole params) {
		return bsRoleServiceInterface.findRoleByParam(params);
	}

	@PostMapping("/updateRoleByParam")
	public boolean updateRoleByParam(@RequestBody BsRole params) throws Exception {
		bsRoleServiceInterface.updateRoleByParam(params);
		return true;
	}

	@PostMapping("/updateMenuByParam")
	public boolean updateMenuByParam(@RequestBody BsRole params) throws Exception {
		bsRoleServiceInterface.updateMenuByParam(params);
		return true;
	}

	@PostMapping("/addRole")
	public boolean addRole(@RequestBody BsRole bsRole) throws Exception {
		bsRoleServiceInterface.addRole(bsRole);
		return true;
	}
}